<?php
class UsersController extends AppController {
	var $helpers = array('Html', 'Form','Session');
	var $uses = array('User');
	
	public function beforeFilter() {
		$this->Auth->allow("login,logout");
		$this->layout = 'login';
		//debug(AuthComponent::password('admin'));
	}
	
	public function signup () {
		
	}
	
	public function login() {
		//debug($this->data);
		//debug(Security::hash('admin'));
		// debug(Security::hash($this->data['Users']['password']));
	    if ($this->request->is('post')) {
	        if ($this->Auth->login()) {
	            return $this->redirect($this->Auth->redirect());
	        } else {
	            $this->Session->setFlash(__('Username or password is incorrect'), 'default', array(), 'auth');
	        }
	    }
		
		
	}
	
	public function logout() {
 	   $this->redirect($this->Auth->logout());
	}
	
	public function updateProfile() {
	
	}
	
	public function forgotPassword() {
	
	}	
}
